package com.vanzo.some.appinfo;

import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;

import java.text.Collator;
import java.util.Comparator;
import java.util.List;

/**
 * Created by tisen on 2017/10/26.
 */

public class AppInfo implements Parcelable {
    private String label;
    private String packageName;
    private String launcherActivityName;
    private String version;
    private Drawable icon;

    public AppInfo() {
    }

    protected AppInfo(Parcel in) {
        label = in.readString();
        packageName = in.readString();
        launcherActivityName = in.readString();
        version = in.readString();
    }

    public static final Creator<AppInfo> CREATOR = new Creator<AppInfo>() {
        @Override
        public AppInfo createFromParcel(Parcel in) {
            return new AppInfo(in);
        }

        @Override
        public AppInfo[] newArray(int size) {
            return new AppInfo[size];
        }
    };

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getLauncherActivityName() {
        return launcherActivityName;
    }

    public void setLauncherActivityName(String launcherActivityName) {
        this.launcherActivityName = launcherActivityName;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public Drawable getIcon() {
        return icon;
    }

    public void setIcon(Drawable icon) {
        this.icon = icon;
    }

    @Override
    public String toString() {
        return "AppInfo{" +
                "label='" + label + '\'' +
                ", packageName='" + packageName + '\'' +
                ", launcherActivityName='" + launcherActivityName + '\'' +
                ", version='" + version + '\'' +
                ", icon=" + icon +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(label);
        dest.writeString(packageName);
        dest.writeString(launcherActivityName);
        dest.writeString(version);
    }
}
